package net.huashitong.scheduling.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import net.huashitong.scheduling.entity.Resources;
import net.huashitong.scheduling.filter.ResourcesFilter;

import com.sirdc.modules.core.dao.GenericQuery;
import com.sirdc.modules.core.dao.StringDao;

@Repository
public class ResourcesDao extends StringDao<Resources> {

	public List<Resources> queryByType(ResourcesFilter filter) {
		GenericQuery query = createQuery("obj");
		query.append(" and obj.type = :type").setParam("type", filter.getType());
		return query.listResult();
	}

	public Resources queryDetailValue(ResourcesFilter filter) {
		GenericQuery query = createQuery("obj");
		query.append(" and obj.sysId = :sysId").setParam("sysId", filter.getSysId());
		return query.singleResult();
	}

}
